package com.black.app.domain.req.my;

import cn.hutool.core.util.StrUtil;
import com.black.common.core.domain.page.PageAbstructReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Setter
@Getter
@ApiModel(description = "我的发布帖子首页请求对象")
public class MyUserPostInformationReq extends PageAbstructReq {

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "用户昵称")
    private String nick_name;

    @ApiModelProperty(value = "帖子标题")
    private String title;

    @ApiModelProperty(value = "开始时间")
    private Date beginTime;

    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    /**
     * 排序
     *
     * @return
     */
    @ApiModelProperty(hidden = true)
    @Override
    public String getOrderBy() {
        if (StrUtil.isNotBlank(super.getOrderByColumn())) {
            return super.getOrderByColumn() + " " + super.getIsAsc();
        }
        return null;
    }
}
